home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Rokusho.bin / pc / assets / rokusho.dxr / 00286_Script_286 < prev    next >
Text File  |  2001-12-07  |  9KB  |  290 lines

  1. property minuteman, tempdigits, tempscore, digit_one, digit_two, digit_three, digit_four, brassurl, tempscoreone, tempscoretwo, tempscorethree
  2. global thescore, finalcode, scoredigits, timescore, gotobrassurl, myFile, squam, oldscore, completo
  3.  
  4. on beginsprite me
  5.   completo = 0
  6.   set the floatPrecision = 0
  7.   squam = getOSdirectory()&"\"
  8.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  9.   myFile = new(xtra "fileio") -- Create an instance of FileIO
  10.   --  openFile(myFile,the moviePath&"info.txt",1) --Open the file with read access
  11.   openFile(myFile,squam&"infor.txt",1) --Open the file with read access
  12.   myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt'
  13.   if readFile(myFile)=VOID then --checks to see if this file exists
  14.     oldscore = 0
  15.   else
  16.     oldscore = myVariable
  17.     closeFile(myFile) -- Close the file
  18.   end if
  19.   myFile = 0 -- Dispose of the instance
  20.   
  21.   
  22.   minuteman = timescore/60
  23.   if minuteman < 60 then
  24.     thescore = 10
  25.   else if minuteman > 59 and minuteman < 120 then
  26.     thescore = 9
  27.   else if minuteman > 119 and minuteman < 180 then
  28.     thescore = 8
  29.   else if minuteman > 179 and minuteman < 240 then
  30.     thescore = 7
  31.   else if minuteman > 239 and minuteman < 360 then
  32.     thescore = 6
  33.   else if minuteman > 359 and minuteman < 420 then
  34.     thescore = 5
  35.   else if minuteman > 419 and minuteman < 480 then
  36.     thescore = 4
  37.   else if minuteman > 479 and minuteman < 540 then
  38.     thescore = 3
  39.   else if minuteman > 539 and minuteman < 600 then
  40.     thescore = 2
  41.   else
  42.     thescore = 1
  43.   end if
  44.   thescore = thescore + oldscore
  45.   put thescore into member("holdscore")
  46.   
  47.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  48.   myFile = new(xtra "fileio")    -- Create an instance of FileIO
  49.   --  openFile (myFile, the moviePath &"info.txt",0)--Open the file with R/W access  
  50.   openFile (myFile, squam&"infor.txt",0)--Open the file with R/W access  
  51.   delete(myFile) --deletes the file
  52.   --  createFile (myFile, the moviePath &"info.txt") --creates the file again
  53.   createFile (myFile, squam&"infor.txt") --creates the file again
  54.   --  openFile(myFile,the moviePath &"info.txt",0) --Open the file with R/W access
  55.   openFile(myFile, squam&"infor.txt",0) --Open the file with R/W access
  56.   --  mySaveString = thescore --puts the contents of the field 'input' into the variable mySaveString
  57.   mySaveString = member("holdscore").text
  58.   writeString(myFile,mySaveString) --writes text to the file
  59.   
  60.   closeFile(myFile) -- Close the file 
  61.   myFile = 0 -- Dispose of the instance
  62.   
  63.   --  put minuteman into member ("timedisplay")
  64.   --  
  65.   brassurl = "http://www.medabots.com/rewards/coding/rewards_give.pl?b=fdvbnhsdlihv"
  66.   
  67.   if thescore > 10000 then
  68.     thescore = 9999
  69.   end if
  70.   
  71.   if thescore > 0 and thescore <10 then
  72.     scoredigits = 1
  73.     tempscore = thescore
  74.     tempdigits = 1
  75.   else if thescore > 9 and thescore <100 then
  76.     scoredigits = 2
  77.     tempscore = thescore
  78.     tempdigits = 2
  79.   else if thescore >99 and thescore < 1000 then
  80.     scoredigits = 3
  81.     tempscore = thescore
  82.     tempdigits = 3
  83.   else if thescore >999 and thescore < 10000 then
  84.     scoredigits = 4
  85.     tempscore = thescore
  86.     tempdigits = 4
  87.   end if
  88.   
  89.   --  Four Figures
  90.   if tempdigits = 4 then
  91.     if tempscore > 999 and tempscore <2000 then
  92.       digit_four = "q"
  93.       tempscore = tempscore - 1000
  94.       tempdigits = 3
  95.     end if
  96.     if tempscore > 1999 and tempscore <3000 then
  97.       digit_four = "u"
  98.       tempscore = tempscore - 2000
  99.       tempdigits = 3
  100.     end if
  101.     if tempscore > 2999 and tempscore <4000 then
  102.       digit_four = "j"
  103.       tempscore = tempscore - 3000
  104.       tempdigits = 3
  105.     end if
  106.     if tempscore > 3999 and tempscore <5000 then
  107.       digit_four = "c"
  108.       tempscore = tempscore - 4000
  109.       tempdigits = 3
  110.     end if
  111.     if tempscore > 4999 and tempscore <6000 then
  112.       digit_four = "k"
  113.       tempscore = tempscore - 5000
  114.       tempdigits = 3
  115.     end if
  116.     if tempscore > 5999 and tempscore <7000 then
  117.       digit_four = "b"
  118.       tempscore = tempscore - 6000
  119.       tempdigits = 3
  120.     end if
  121.     if tempscore > 6999 and tempscore <8000 then
  122.       digit_four = "r"
  123.       tempscore = tempscore - 7000
  124.       tempdigits = 3
  125.     end if
  126.     if tempscore > 7999 and tempscore <9000 then
  127.       digit_four = "w"
  128.       tempscore = tempscore - 8000
  129.       tempdigits = 3
  130.     end if
  131.     if tempscore > 8999 and tempscore <10000 then
  132.       digit_four = "n"
  133.       tempscore = tempscore - 9000
  134.       tempdigits = 3
  135.     end if
  136.   end if
  137.   
  138.   
  139.   
  140.   
  141.   --  Three Figures
  142.   if tempdigits = 3 then
  143.     if tempscore < 99 then
  144.       digit_three = "x"
  145.       tempscore = tempscore
  146.       tempdigits = 2
  147.     end if
  148.     if tempscore > 99 and tempscore <200 then
  149.       digit_three = "q"
  150.       tempscore = tempscore - 100
  151.       tempdigits = 2
  152.     end if
  153.     if tempscore > 199 and tempscore <300 then
  154.       digit_three = "u"
  155.       tempscore = tempscore - 200
  156.       tempdigits = 2
  157.     end if
  158.     if tempscore > 299 and tempscore <400 then
  159.       digit_three = "j"
  160.       tempscore = tempscore - 300
  161.       tempdigits = 2
  162.     end if
  163.     if tempscore > 399 and tempscore <500 then
  164.       digit_three = "c"
  165.       tempscore = tempscore - 400
  166.       tempdigits = 2
  167.     end if
  168.     if tempscore > 499 and tempscore <600 then
  169.       digit_three = "k"
  170.       tempscore = tempscore - 500
  171.       tempdigits = 2
  172.     end if
  173.     if tempscore > 599 and tempscore <700 then
  174.       digit_three = "b"
  175.       tempscore = tempscore - 600
  176.       tempdigits = 2
  177.     end if
  178.     if tempscore > 699 and tempscore <800 then
  179.       digit_three = "r"
  180.       tempscore = tempscore - 700
  181.       tempdigits = 2
  182.     end if
  183.     if tempscore > 799 and tempscore <900 then
  184.       digit_three = "w"
  185.       tempscore = tempscore - 800
  186.       tempdigits = 2
  187.     end if
  188.     if tempscore > 899 and tempscore <1000 then
  189.       digit_three = "n"
  190.       tempscore = tempscore - 900
  191.       tempdigits = 2
  192.     end if
  193.   end if
  194.   
  195.   
  196.   --  Two Figures
  197.   if tempdigits = 2 then
  198.     if tempscore < 10 then
  199.       digit_two = "x"
  200.       tempscore = tempscore
  201.       tempdigits = 1
  202.     end if
  203.     
  204.     if tempscore > 9 and tempscore <20 then
  205.       digit_two = "q"
  206.       tempscore = tempscore - 10
  207.       tempdigits = 1
  208.     end if
  209.     if tempscore > 19 and tempscore <30 then
  210.       digit_two = "u"
  211.       tempscore = tempscore - 20
  212.       tempdigits = 1
  213.     end if
  214.     if tempscore > 29 and tempscore <40 then
  215.       digit_two = "j"
  216.       tempscore = tempscore - 30
  217.       tempdigits = 1
  218.     end if
  219.     if tempscore > 39 and tempscore <50 then
  220.       digit_two = "c"
  221.       tempscore = tempscore - 40
  222.       tempdigits = 1
  223.     end if
  224.     if tempscore > 49 and tempscore <60 then
  225.       digit_two = "k"
  226.       tempscore = tempscore - 50
  227.       tempdigits = 1
  228.     end if
  229.     if tempscore > 59 and tempscore <70 then
  230.       digit_two = "b"
  231.       tempscore = tempscore - 60
  232.       tempdigits = 1
  233.     end if 
  234.     if tempscore > 69 and tempscore <80 then
  235.       digit_two = "r"
  236.       tempscore = tempscore - 70
  237.       tempdigits = 1
  238.     end if
  239.     if tempscore > 79 and tempscore <90 then
  240.       digit_two = "w"
  241.       tempscore = tempscore - 80
  242.       tempdigits = 1
  243.     end if
  244.     if tempscore > 89 and tempscore <100 then
  245.       digit_two = "n"
  246.       tempscore = tempscore - 90
  247.       tempdigits = 1
  248.     end if
  249.     
  250.   end if
  251.   --  One Figure
  252.   if tempdigits = 1 then
  253.     if tempscore = 0 then
  254.       digit_one = "x"
  255.     else if tempscore = 1 then
  256.       digit_one = "q"
  257.     else if tempscore = 2 then
  258.       digit_one = "u"
  259.     else if tempscore = 3 then
  260.       digit_one = "j"
  261.     else if tempscore = 4 then
  262.       digit_one = "c"
  263.     else if tempscore = 5 then
  264.       digit_one = "k"
  265.     else if tempscore = 6 then
  266.       digit_one = "b"
  267.     else if tempscore = 7 then
  268.       digit_one = "r"
  269.     else if tempscore = 8 then
  270.       digit_one = "w"
  271.     else if tempscore = 9 then
  272.       digit_one = "n"
  273.     end if
  274.   end if
  275.   
  276.   if scoredigits = 1 then
  277.     finalcode = digit_one
  278.   else if scoredigits = 2 then
  279.     finalcode = digit_two&digit_one
  280.   else if scoredigits = 3 then
  281.     finalcode = digit_three&digit_two&digit_one
  282.   else if scoredigits = 4 then
  283.     finalcode = digit_four&digit_three&digit_two&digit_one
  284.   end if
  285.   
  286.   --  put brassurl&finalcode into member("urldisplay")
  287.   gotobrassurl = brassurl&finalcode
  288. end
  289.  
  290.